Skip to content

Conversation

@palomagr
Copy link
Contributor

@palomagr palomagr commented Mar 30, 2018

I added the changes that allowed me to do the installation. At first I installed the latest version of Tensor-flow and it needed CUDA 9.0. I tested python version 3.6 and 3.5 and only works with 3.5. As a result of all the changes I made, ML Agents run and get trained correctly.

andersonaddo and others added 7 commits March 26, 2018 15:32
There were some important things that should have been mentioned in this tutorial, and it took me a while to figure them out. Most importantly, it was never mentioned how to properly end a training session in the Anaconda prompt to receive an exported .bytes file.
Slightly improved the instructions in the Ball Balancing tutorial
I added the changes that allowed me to do the installation.
@awjuliani awjuliani requested review from mmattar and shihzy March 30, 2018 23:23

```
pip install tensorflow
pip install tensorflow==1.4.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our requirement.txt, we already specified tensorflow==1.4.0 version, why would you specify it here again?

Copy link
Contributor Author

@palomagr palomagr Mar 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some people copy and paste code from tutorials. If done like that conda would install the latest version of TensorFlow and it will ask for CUDA 9.0 later, hence the installation will give an error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see.


```
conda create -n ml-agents python=3.6
conda create -n ml-agents python=3.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should change it from 3.6 to 3.5 here, since 3.6.5 doesn't work yet.

```
pip install .
pip install docopt
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why will you install docopt again after "pip install ."?

Copy link
Contributor Author

@palomagr palomagr Mar 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow, the pip install . didn't include docopt and gave an error while training.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem on my side, but with pyyaml.

Copy link
Contributor Author

@palomagr palomagr Mar 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need Visual Studio Windows SDK 2015 to install pyyaml, also:
Had to paste this “lib” folder from C:\Program Files (x86)\Microsoft Visual Studio 14.0\lib
Into C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\PlatformSDK\lib

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I solved it via command: easy_install pyyaml

Copy link
Contributor Author

@palomagr palomagr Mar 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. Perhaps all of these issues need to be in a "troubleshooting" page?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't hurt to execute one more command if it get people through.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are planning to add a FAQ page, where we can add this in later.

### Install Nvidia CUDA toolkit

[Download](https://developer.nvidia.com/cuda-toolkit-archive) and install the CUDA toolkit from Nvidia's archive. The toolkit includes GPU-accelerated libraries, debugging and optimization tools, a C/C++ compiler and a runtime library and is needed to run ML-Agents. In this guide, we are using version 8.0.61 ([direct link](https://developer.nvidia.com/compute/cuda/8.0/Prod2/network_installers/cuda_8.0.61_win10_network-exe)).
[Download](https://developer.nvidia.com/cuda-toolkit-archive) and install the CUDA toolkit from Nvidia's archive. The toolkit includes GPU-accelerated libraries, debugging and optimization tools, a C/C++ (Step: Visual Studio 2015) compiler and a runtime library and is needed to run ML-Agents. In this guide, we are using version 8.0.61 ([direct link](https://developer.nvidia.com/compute/cuda/8.0/Prod2/network_installers/cuda_8.0.61_win10_network-exe)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why uninstall the Visual Studio 2015 helps here? Could you please explain?
Also maybe provide a hyperlink here to link to your added section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Visual Studio 2017 does not work with CUDA 8.0. Unity comes by default with Visual Studio 2017 and when installing CUDA 8.0 it says the error that "No supported version of Visual Studio was found. Some components of CUDA Toolkit will not work properly. Please install Visual Studio first to get the full functionality". So Visual Studio needs to be uninstalled, and install Visual Studio 2015, or at least
Visual C++ Redistributable for Visual Studio 2015: https://www.microsoft.com/en-us/download/details.aspx?id=48145

Visual Studio Community with Visual Studio 2015 Windows SDK: https://msdn.microsoft.com/en-us/library/mt683786.aspx

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

Found device 0 with properties ...
```
<p>
Step Visual Studio 2015: unistall Visual Studio 2017 that comes with the Unity installation, download Visual Studio Enterprise 2015 and install the SDK when installing. If you don't want to install Visual Studio Enterprise 2015, at least install Visual C++ Redistributable for Visual Studio 2015 and Visual Studio 2015 Windows SDK.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unistall -> uninstall

Copy link
Contributor

@xiaomaogy xiaomaogy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please address the comments I had regarding your PR? After that I will merge your stuff. Thanks for contributing.

I added more comments to explain why using python 3.5, Tensorflow 1.4.0, and comments and links for Visual Studio 2015.

I erased the docopt installation and the part for the folders:
Had to paste this “lib” folder from C:\Program Files (x86)\Microsoft Visual Studio 14.0\lib
Into C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\PlatformSDK\lib

Because this might have been only a problem for me. Thanks,
@shihzy
Copy link
Contributor

shihzy commented Apr 2, 2018

please switch the merge to develop, no master

@palomagr palomagr changed the base branch from master to develop April 2, 2018 16:44
@palomagr
Copy link
Contributor Author

palomagr commented Apr 2, 2018

Changed the pull request from Master to develop. Thanks,

@xiaomaogy
Copy link
Contributor

@unityjeffrey @mmattar I've manually checked all the changes, and it works. Maybe we can also merge this into master since this is all docs change?

Copy link

@mmattar mmattar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making these improvements! I made a few stylistic comments, but otherwise looks great.

```python
python3 python/learn.py <env_file_path> --run-id=<run-identifier> --train
```
**Note**: If you're using Anaconda, don't forget to activate the ml-agents environment first.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "activate the ml-agents environment" mean? This would be the only place in the Docs that we mention that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Activate means, "write in the command line 'activate ml-agents'", and the environment that was created before is activated. Tensorflow also needs to be activated.

## Step 1: Install Python via Anaconda

[Download](https://www.anaconda.com/download/#windows) and install Anaconda for Windows. By using Anaconda, you can manage separate environments for different distributions of Python. Python 3 is required as we no longer support Python 2. In this guide, we are using Python version 3.6 and Anaconda version 5.1 ([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe) or [32-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86.exe) direct links).
[Download](https://www.anaconda.com/download/#windows) and install Anaconda for Windows. By using Anaconda, you can manage separate environments for different distributions of Python. Python 3 is required as we no longer support Python 2. In this guide, we are using Python version 3.5 (Anaconda comes with python 3.6, we will create and environment with python 3.5) and Anaconda version 5.1 ([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe) or [32-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86.exe) direct links).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In "(Anaconda comes with python 3.6, we will create and environment with python 3.5)" two quick comments:

  • python --> Python
  • and --> an


After installation, you must open __Anaconda Navigator__ to finish the setup. From the Windows search bar, type _anaconda navigator_. You can close Anaconda Navigator after it opens.

If environmental variables were not created, or if you see the error "conda is not recognized as internal or external command", in System Variables "Path" add:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"If environmental" --> "If environment"

```
Found device 0 with properties ...
```
<p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the paragraph html tags, we typically do not use them.

palomagr added 5 commits April 5, 2018 11:10
Hi, I did the changes in style. Thanks,
Fixed the links.
Thanks,
Links are good finally.
Links are good finally.
Copy link

@mmattar mmattar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the requested changes.

@mmattar mmattar merged commit ba79dd2 into Unity-Technologies:develop Apr 6, 2018
@palomagr
Copy link
Contributor Author

palomagr commented Apr 9, 2018

Should I add a pull request to Master branch? @unityjeffrey @mmattar @xiaomaogy the detail between Python 3.5 and Python 3.6 is very important so perhaps it is good to add these changes to the master branch.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants